<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="browsermode" content="application">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="Cache" content="no-cache">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <!-- 禁止百度转码 -->
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="format-detection" content="telephone=no">
    <title>申请成为VIP</title>
    <link rel="stylesheet" href="${request.contextPath}/web/css/reset.css?v=${verison!}">
    <link rel="stylesheet" href="${request.contextPath}/web/css/base.css?v=${verison!}">
    <link rel="stylesheet" href="${request.contextPath}/web/css/vip-apply.css?v=${verison!}">
    <link rel="stylesheet" href="${request.contextPath}/web/css/ydui.css">
    <link rel="stylesheet" href="${request.contextPath}/plug/layui/css/layui.css" media="all">
</head>
<body style="background-color: rgb(245, 245, 245);">
<div data-role="page">
    <div class="app">
        <div class="vipApply absolute router">
            <div class="list">
                <div class="item acea-row row-between-wrapper">
                    <div class="name">姓&nbsp; &nbsp; &nbsp; &nbsp;名</div>
                    <input type="text" placeholder="请输入姓名" required="required" id="name">
                </div>
                <div class="item acea-row row-between-wrapper">
                    <div class="name">联系方式</div>
                    <input type="text" placeholder="请输入联系方式" required="required" id="phone">
                </div>
                <div class="item acea-row row-between-wrapper">
                    <div class="name">地&nbsp; &nbsp; &nbsp; &nbsp;址</div>
                    <input type="text" placeholder="请输入地址" required="required" id="address">
                </div>
            </div>
            <div style="height: 2rem; border-top: .01rem solid #DADADA"></div>
            <a class="keepBnt bg-color-red" onclick="buyVip(1)">支付费用成为VIP</a>
            <a class="keepBnt bg-color-black" onclick="buyVip(2)">购买商品成为VIP</a>
        </div>
    </div>
    <#include "include/right.html" />
</div>
</body>
<script type="text/javascript" src="${request.contextPath}/web/js/media_750.js"></script>
<script type="text/javascript" src="${request.contextPath}/web/js/jquery.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/web/js/jquery.mobile.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/web/js/ydui.js"></script>
<script type="text/javascript" src="${request.contextPath}/web/js/common.js"></script>
<script src="${request.contextPath}/js/layer.js"></script>
<script>
    function buyVip(type){
        var obj = new Object();
        obj["name"] = $.trim($("#name").val());
        obj["phone"] =  $.trim($("#phone").val());
        obj["address"] =  $.trim($("#address").val());
        obj["type"] =  1;
        if("" == obj["name"]){
            layer.msg("姓名不能为空！")
            return;
        }
        if("" == obj["phone"]){
            layer.msg("联系方式不能为空！")
            return;
        }
        if(!isPhoneNo(obj["phone"])){
            layer.msg("联系方式不正确！")
            return;
        }
        if("" == obj["address"]){
            layer.msg("地址不能为空！")
            return;
        }
        $.ajax({
              type: 'POST',
              url: '${request.contextPath}/web/applyInfo/add',
              data: JSON.stringify(obj),
              dataType:'json',
              contentType:'application/json',
              success: function(data){
                  if(data.code==200){
                     if(type == 1){
                        window.location.href="${request.contextPath}/weixin/unifiedOrder/"+data.data;
                     }else{
                        window.location.href="${request.contextPath}/web/searchResult?isBevip=1";
                     }
                  }else{
                     layer.msg(data.msg)
                  }
              }
        });
    }
</script>
</html>